package com.company;

import java.util.Base64;

public class JavaBase64 {
    public static void main(String[] args) {
       String sendMsg = "base64 encode info";
       String encodeMsg = new String(Base64.getEncoder().encode(sendMsg.getBytes()));
       System.out.println("base 64 encoded msg: " + encodeMsg);
       String originMsg = new String(Base64.getDecoder().decode(encodeMsg.getBytes()));
       System.out.println("base 64 decode msg: " + originMsg);
    }
}
